//
//  VIPVideoPictureCell.m
//  copyrightTrading
//
//  Created by 郭子一 on 2020/10/7.
//  Copyright © 2020 郭子一. All rights reserved.
//

#import "VIPVideoPictureCell.h"

@interface VIPVideoPictureCell ()
@property (nonatomic, strong) UIImageView *img;

@property (nonatomic, strong) UIImageView *selectImg;
@end

@implementation VIPVideoPictureCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.contentView.backgroundColor = RGB_VALUE(0xF5F5F5);
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    self.img = [[UIImageView alloc] init];
    self.img.backgroundColor = UIColor.brownColor;
    self.img.layer.masksToBounds = YES;
    self.img.layer.cornerRadius = 10;
    [self.contentView addSubview:self.img];
    [self.img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
    }];
    
    self.selectImg = [[UIImageView alloc] init];
    self.selectImg.image = [UIImage imageNamed:@"MineCartSelect"];
    [self.contentView addSubview:self.selectImg];
    [self.selectImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.offset(10);
        make.width.height.mas_equalTo(24);
    }];
    self.selectImg.hidden = YES;
}

- (void)setDataDic:(NSDictionary *)dataDic
{
    _dataDic = dataDic;
    [self.img m_setImageWithUrlString:dataDic[@"thumb"] placeholder:@"placeholderImg"];
}

- (void)setIsSelcted:(BOOL)isSelcted
{
    _isSelcted = isSelcted;
    self.selectImg.hidden = !isSelcted;
    
}
@end
